<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ctg="http://www.crotouristguide.com/taglib">
	<h:form>
		<rich:panel styleClass="blue-panel">
			<ctg:status />
			<s:decorate id="wizar" template="/templates/wizard.xhtml">
				<ui:define name="step-title">#{messages['label.suggest.step.title.7']}</ui:define>
				<ui:define name="step-tip">#{messages['label.suggest.step.tip.7']}</ui:define>
				<ui:define name="step-form">
					<s:decorate id="odDecoration" template="/templates/edit.xhtml">
						<ui:define name="label">#{messages['label.datum.od']}</ui:define>
						<rich:calendar value="#{objektSuggest.cijena.datumOd}" datePattern="dd.MM."
							popup="true" showApplyButton="false" required="true" styleClass="field" />
					</s:decorate>

					<s:decorate id="doDecoration" template="/templates/edit.xhtml">
						<ui:define name="label">
						#{messages['label.datum.do']}</ui:define>
						<rich:calendar value="#{objektSuggest.cijena.datumDo}" datePattern="dd.MM."
							popup="true" showApplyButton="false" required="true"  styleClass="field"/>
					</s:decorate>
					<s:decorate id="danDecoration" template="/templates/edit.xhtml" rendered="#{objektSuggest.tipObjekta.idTipaObjekta != 4}">
						<ui:define name="label">#{messages['label.dan']}</ui:define>
						<h:inputText value="#{objektSuggest.cijena.dan}" styleClass="field" required="true"/><h:outputText value="EUR" />
					</s:decorate>
					<s:decorate id="jednokrevetnaDecoration"
						template="/templates/edit.xhtml" rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
						<ui:define name="label">#{messages['label.jednokrevetna']}</ui:define>
						<h:inputText value="#{objektSuggest.cijena.jednokrevetna}" styleClass="field" /><h:outputText value="EUR" />
					</s:decorate>
					<s:decorate id="dvokrevetnaDecoration"
						template="/templates/edit.xhtml" rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
						<ui:define name="label">#{messages['label.dvokrevetna']}</ui:define>
						<h:inputText value="#{objektSuggest.cijena.dvokrevetna}" styleClass="field" /><h:outputText value="EUR" />
					</s:decorate>
					<s:decorate id="trokrevetnaDecoration"
						template="/templates/edit.xhtml" rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
						<ui:define name="label">#{messages['label.trokrevetna']}</ui:define>
						<h:inputText value="#{objektSuggest.cijena.trokrevetna}" styleClass="field" /><h:outputText value="EUR" />
					</s:decorate>
					<s:decorate id="apartmanDecoration"
						template="/templates/edit.xhtml" rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
						<ui:define name="label">#{messages['label.apartman']}</ui:define>
						<h:inputText value="#{objektSuggest.cijena.apartman}" styleClass="field" /><h:outputText value="EUR" />
					</s:decorate>
					<a:commandButton styleClass="submit"
						value="#{messages['label.osobine.input.button.addproperty']}"
						action="#{objektSuggest.dodajCijenu}" reRender="wizar,edataXXX" />
				</ui:define>
				<ui:define name="buttn-cancel">
					<h:commandButton styleClass="submit"
						value="#{messages['label.objekt.input.button.update']}"
						action="#{objektSuggest.zapisiObjekt}" rendered="#{objektSuggest.editMode}" immediate="true"/>
						<ctg:nbsp/>
					<a:commandButton value="#{messages['label.input.cancel']}"
						action="end" immediate="true" />
				</ui:define>
				<ui:define name="buttn-prev">
					<a:commandButton value="#{messages['label.input.back']}"
						action="#{objektSuggest.previousStep}" reRender="wizardpanel" immediate="true" />
				</ui:define>
				<ui:define name="buttn-next">
					<a:commandButton value="#{messages['label.input.next']}"
						action="#{objektSuggest.nextStep}" reRender="wizardpanel"
						immediate="true" />
				</ui:define>
				<ui:define name="step-entered-data">
					<a:outputPanel id="edataXXX">
						<h:dataTable value="#{objektSuggest.cijene}" var="uo"
							rendered="#{! empty objektSuggest.cijene}"
							rowClasses="rowOdd,rowEven">
							<f:facet name="header">#{messages['title.cijene.list']}</f:facet>
							<h:column>
								<f:facet name="header">#{messages['label.datum.od']}</f:facet>
								<h:outputText value="#{uo.datumOd}" />
							</h:column>
							<h:column>
								<f:facet name="header">#{messages['label.datum.do']}</f:facet>
								<h:outputText value="#{uo.datumDo}" />
							</h:column>
							<h:column rendered="#{objektSuggest.tipObjekta.idTipaObjekta != 4}">
								<f:facet name="header">#{messages['label.dan']}</f:facet>
								<h:outputText value="#{uo.dan} EUR" />
							</h:column>
							<h:column rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
								<f:facet name="header">#{messages['label.jednokrevetna']}</f:facet>
								<h:outputText value="#{uo.jednokrevetna} EUR" />
							</h:column>
							<h:column rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
								<f:facet name="header">#{messages['label.dvokrevetna']}</f:facet>
								<h:outputText value="#{uo.dvokrevetna} EUR" />
							</h:column>
							<h:column rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
								<f:facet name="header">#{messages['label.trokrevetna']}</f:facet>
								<h:outputText value="#{uo.trokrevetna} EUR" />
							</h:column>		
							<h:column rendered="#{objektSuggest.tipObjekta.idTipaObjekta == 4}">
								<f:facet name="header">#{messages['label.apartman']}</f:facet>
								<h:outputText value="#{uo.apartman} EUR" />
							</h:column>	
							<h:column>
								<f:facet name="header">#{messages['label.action']}</f:facet>
								<a:commandLink styleClass="submit"
									value="#{messages['label.button.remove']}"
									action="#{objektSuggest.ukloniCijenu(uo)}"
									reRender="wizardpanel" immediate="true" />
							</h:column>
						</h:dataTable>
					</a:outputPanel>
				</ui:define>
			</s:decorate>
		</rich:panel>

	</h:form>
</ui:component>
